package com.example.demo.dao;

import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDAO {

    @Select("select * from users where (username=#{username}) and (password=#{password})")
    User selectOneUser(User user);

    @Insert("insert into users values (#{id}, #{username}, #{password})")
    int insert(User user);

    @Select("select * from users where (username=#{username})")
    User findUser(String username);

}
